﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UploadImage.aspx.cs" Inherits="UserKTXD.DCTEDU_.QuanLy.UploadImage" %>

<%@ Register Assembly="CuteWebUI.AjaxUploader" Namespace="CuteWebUI" TagPrefix="cc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <link href="../../CSS/Home.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        function upload_click() {
            var submitbutton = document.getElementById('<%=cmdUpload.ClientID %>');
            var uploadobj = document.getElementById('<%=UploadImage2.ClientID %>');
            if (!window.filesuploaded) {
                if (uploadobj.getqueuecount() > 0) {
                    uploadobj.startupload();
                }
                else {
                    var uploadedcount = parseInt(submitbutton.getAttribute("itemcount")) || 0;
                    if (uploadedcount > 0) {
                        return true;
                    }
                    alert("Chưa chọn Tập tin để upload");
                }
                return false;
            }
            window.filesuploaded = false;
            return true;
        }
    </script>
</head>
<body>
    <form id="Form1" runat="server">
    <asp:HiddenField ID="H_FileChonLai" Value="" runat="server" />
    <table border="0" width="100%" cellpadding="0" cellspacing="0">
        <tr>
            <td colspan="4" height="10">
            </td>
        </tr>
        <tr>
            <td width="20">
            </td>
            <td width="80" class="hrm_title_blue" valign="top" style="padding-top: 3px">
                Tải hình ảnh
            </td>
            <td width="7" class="hrm_title_blue" valign="top" style="padding-top: 3px">
                :
            </td>
            <td valign="top">
                <cc1:UploadAttachments runat="server" CancelButtonStyle-CssClass="hrm_button" InsertButtonStyle-CssClass="hrm_button"
                    ShowCheckBoxes="False" MultipleFilesUpload="false" ManualStartUpload="true" ID="UploadImage2"
                    InsertText="Chọn ảnh" CancelAllMsg="Hủy tất cả" UploadingMsg="...Đang tải ảnh..."
                    OnFileUploaded="UploadImage_FileUploaded" OnAttachmentRemoveClicked="UploadImage_AttachmentRemoveClicked"
                    RemoveButtonText="Xóa">
                    <InsertButtonStyle Font-Size="11px" />
                    <ValidateOption MaxSizeKB="2048" />
                    <CancelButtonStyle CssClass="hrm_button" />
                </cc1:UploadAttachments>
                <asp:Button runat="server" ID="cmdUpload" Style="font-family: Tahoma; font-size: 11px"
                    OnClientClick="return upload_click()" Text="Tải ảnh" OnClick="cmdUpload_Click" />
            </td>
        </tr>
        <tr>
            <td colspan="4" height="30">
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
